import { request } from "@/utils/product";
import type { BrandItemType, ReqGetBrandListResponse, } from "./model/brandListTypes";

// 获取商品列表
export function reqGetBrandList(
    page: number,
    limit: number,
) {
    return request.get<any, ReqGetBrandListResponse>(
        `/admin/product/baseTrademark/${page}/${limit}`,
    );
};

// 删除商品
// 添加/更新/删除请求接口返回的响应数据的data属性为null
export const reqRemoveBrand = (id: number) => {
    return request.delete<any, null>(`/admin/product/baseTrademark/remove/${id}`);
};

// 添加商品
export const reqAddBrand = (row: BrandItemType) => {
    return request.post<any, null>(`/admin/product/baseTrademark/save`, row);
};

// 修改商品
export const reqUpdateBrand = (row: BrandItemType) => {
    return request.put<any, null>(`/admin/product/baseTrademark/update`, row);
};
